package com.itany.mall.entity;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class OrderDetail extends MallData implements Cloneable, Serializable {
	private static final long serialVersionUID = 1L;
	// private Long id;
	private Long orderId;
	private Order order;
	private Long productId;
	private Product product;
	private Integer productSum;
	private Double price;
	private Long userId;
	private User user;

	@Override
	public Object clone() {
		try {
			OrderDetail od = (OrderDetail) super.clone();
			od.order = (Order) this.order.clone();
			od.product = (Product) this.product.clone();
			od.user = (User) this.user.clone();
			return od;
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
			return null;
		}
	}
}
